﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Agr.CQRS.Domain.Events;
using System.Reflection;

namespace Agr.CQRS.Domain
{
    public abstract class AggregateRoot : Entity
    {
        internal int Version { get; set; }
        internal Guid Id { get; set; }

        public AggregateRoot()
        {
            new Aggregate().RegisterEntity(this);
        }

        internal void CreateNew(Guid id)
        {
            Id = id;
            Version = 0;
        }
    }
}
